feat: preserve unknown config keys in extensions#1712
Merged
rlundeen2 merged 4 commits intoMay 13, 2026
Conversation
Contributor
Author
|
Quick follow-up with the practical use case that motivated this patch: we hit a downstream config extension point where product-specific keys need to survive a round-trip through ConfigurationLoader without weakening validation for the known schema. This change keeps the current validation behavior for supported fields, but stops rejecting extra top-level keys that are intentionally owned by an extension. The scope is still limited to config loading plus the targeted tests in tests/unit/setup/test_configuration_loader.py. |
rlundeen2
approved these changes
May 13, 2026
…ensions # Conflicts: # pyrit/setup/configuration_loader.py
- Swap merge order so explicit extensions dict values take priority over unknown top-level keys when both have the same key name - Add test_from_dict_explicit_extensions_wins_on_collision Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
extensionsfield toConfigurationLoaderfor downstream-owned configfrom_dict()intoextensionsinstead of raisingTypeErrorextensionswith unknown top-level keysTesting
Closes #1652